import request from "@/utils/request";
// 创建订单
export const createOrderAPI = (params) => {
  return request({
    url: "/order/generalOrder",
    method: "POST",
    data: params,
  });
};

// 创建私教订单
export const createPrivateOrderAPI = (params) => {
  return request({
    url: "/order/privateOrder",
    method: "POST",
    data: params,
  });
};

// 获取私教可预约时间
export const getPrivateReservationTimeAPI = (params) => {
  return request({
    url: "/reserve/teacherTimeList",
    method: "POST",
    data: params,
  });
};

// 微信支付
export const wechatPaymentAPI = (params) => {
  return request({
    url: "/pay/wxPay",
    method: "POST",
    data: params,
  });
};

// 余额支付
export const balancePaymentAPI = (params) => {
  return request({
    url: "/pay/balancePay",
    method: "POST",
    data: params,
  });
};

// 充值订单
export const rechargeOrderAPI = (params) => {
  return request({
    url: "/order/charge",
    method: "POST",
    data: params,
  });
};

// 获取充值模版
export const getRechargeTemplateAPI = (params) => {
  return request({
    url: "/order/chargeTemplate",
    method: "POST",
    data: params,
  });
};

// 获取订单列表
export const getOrderListAPI = (params) => {
  return request({
    url: "/order/page",
    method: "POST",
    data: params,
  });
};

// 获取订单详情
export const getOrderDetailAPI = (params) => {
  return request({
    url: "/order/detail",
    method: "POST",
    data: params,
  });
};

// 取消订单
export const cancelOrderAPI = (params) => {
  return request({
    url: "/order/cancel",
    method: "POST",
    data: params,
  });
};

// 创建商城订单
export const createMallOrderAPI = (params) => {
  return request({
    url: "/order/mallOrder",
    method: "POST",
    data: params,
  });
};

// Plus 会员商品
export const getPlusMemberGoodsAPI = () => {
  return request({
    url: "/order/vipTemplate",
    method: "POST",
  });
};

// 创建Plus 会员订单
export const createPlusOrderAPI = (params) => {
  return request({
    url: "/order/vipOrder",
    method: "POST",
    data: params,
  });
};

// 创建课程卡订单
export const createCourseCardOrderAPI = (params) => {
  return request({
    url: "/order/cardOrder",
    method: "POST",
    data: params,
  });
};
